package com.wmwu.mybatistest.service.impl;

import com.wmwu.mybatistest.entity.MoneyModel;
import com.wmwu.mybatistest.mapper.MoneyModelMapper;
import com.wmwu.mybatistest.service.IMoneyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author : wmwu
 * @data : 2022/6/22 18:11
 */
@RestController
@RequestMapping("/money")
public class MoneyServiceImpl implements IMoneyService {
    @Autowired
    MoneyModelMapper mapper;

    @Override
    @GetMapping("")
    public List<MoneyModel> getMoneyList() {
        return mapper.selectAll();
    }

    @Override
    @GetMapping("/details")
    public MoneyModel getMoneyById(@RequestParam("id") String id) {
        return mapper.selectById(id);
    }
}
